<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>随机点名</title>
	</head>
	<body>
		<h1>~点名系统~</h1>
		<h3 id="name"></h3>
		<br />
		<input type="button"value="开始" onclick="call()" />
		<script>
			function call(){
				function Student(id,name,hometown){
					this.id=id;
					this.name=name;
					this.hometown=hometown;
					this.output=function(){
						return this.namw+"沉迷学习，日渐消瘦"
					}
				}
					// 创建若干对象
				var yd1=new Student(1,'柯旭海','建德');
				var yd2=new Student(2,'宋自江','宁波');
				var yd3=new Student(3,'相淑雅','宁波');
				var yd4=new Student(4,'宋唐炜','宁波');
				var yd5=new Student(5,'任晓萱','宁波');
				var yd6=new Student(6,'夏启田','温州');
				var yd7=new Student(7,'王俊杰','温州');
				var yd8=new Student(8,'徐翰毅','温州');
				var yd10=new Student(10,'李余良','温州');
				var yd11=new Student(11,'袁斌斌','温州');
				var yd12=new Student(12,'周瑞俊','温州');
				var yd13=new Student(13,'王佐耀','温州');
				var yd14=new Student(14,'梁杰','温州');
				var yd15=new Student(15,'丁振铮','温州');
				var yd16=new Student(16,'何升强','温州');
				var yd17=new Student(17,'陈用群','温州');
				var yd18=new Student(18,'李悌章','温州');
				var yd19=new Student(19,'郑锦','温州');
				var yd20=new Student(20,'王珊珊','温州');
				var yd21=new Student(21,'郑良靖','温州');
				var yd22=new Student(22,'陶伟','温州');
				var yd23=new Student(23,'黄师师','温州');
				var yd24=new Student(24,'汤千晗','温州');
				var yd26=new Student(26,'夏鑫宇','嘉兴');
				var yd27=new Student(27,'薛鹏超','湖州');
				var yd28=new Student(28,'宋琦豪','绍兴');
				var yd29=new Student(29,'余兆俊','金华');
				var yd30=new Student(30,'杨翌','丽水');
				var yd31=new Student(31,'舒柯竣','丽水');
				var yd33=new Student(33,'李家辉','台州');
				var yd34=new Student(34,'陈一颖','台州');
				var yd35=new Student(35,'夏阳','台州');
				var yd36=new Student(36,'尹钦琪','台州');
				var yd37=new Student(37,'朱俊宇','台州');
				var yd38=new Student(38,'姜勋奇','台州');
				var yd39=new Student(39,'杨东平','义乌');
				var yd40=new Student(40,'王洪峰','义乌');
				
				// 创建班级学生对象数组
				var yd1701=[yd1,yd2,yd3,yd4,yd5,yd6,yd7,yd8,yd10,yd11,yd12,yd13,
				yd14,yd15,yd16,yd17,yd18,yd19,yd20,yd21,yd22,yd23,yd24,yd26,yd27,
				yd28,yd29,yd30,yd31,yd33,yd34,yd35,yd36,yd37,yd38,yd39,yd40];
				
				var random=Math.floor(Math.random(*37));
				var h3=document.getElementById('name');
				h3.innerHTML=yd1701[random].id+"\t"+yd1701[random].name+"/t"+
				yd1701[random].hometown+"<br>"+yd1701[random].output();
			}
		</script>
	</body>
</html>
